package reflect;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class Test {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Student student=new Student("打算卡了",'男',18);
        System.out.println(student);
        Constructor c=Student.class.getConstructor(String.class,char.class,int.class);
        Object obj=c.newInstance("王五",'女',19);
        System.out.println(obj);
    }
}
